package ch06;

public class BankAccount 
{
	private int accountNumber;
	private double balance;
	
	public BankAccount(int anAccountNumber)
	{
		accountNumber = anAccountNumber;		
	}
	
	public BankAccount(int anAccountNumber, double initialBalance)
	{
		this(anAccountNumber);
		
		balance = initialBalance;
	}
	
	public void deposit(double amount)
	{
		double newBalance = balance + amount;
		balance = newBalance;
	}
	
	public void withdraw(double amount)
	{
		double newBalance = balance - amount;
		balance = newBalance;
	}
	
	public int getAccountNumber()
	{
		return accountNumber;
	}
	
	public double getBalance()
	{
		return balance;
	}

}
